﻿namespace WMS6.Web.Billing
{
    using System;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;

    public class AccessorialChargesQuery : BasePage
    {
        protected Button btnExport;
        protected Button btnInvAccessorialCharges;
        protected Button btnList;
        protected Button btnSearch;
        protected DropDownList ddlAccessorialType;
        protected DropDownList ddlAccessorialTypeOper;
        protected DropDownList ddlCreatedByOper;
        protected DropDownList ddlCreatedDate;
        protected DropDownList ddlOrderID;
        protected DropDownList ddlOwnerID;
        protected HtmlForm F9180;
        protected HtmlInputHidden hdnActionID;
        protected HtmlInputHidden hdncalendarFlag;
        protected HtmlInputHidden hdnDataFormat;
        protected HtmlHead Head1;
        protected HtmlImage img2;
        protected Label lblAccessorialCharges;
        protected Label lblAccessorialType;
        protected Label lblCreatedBy;
        protected Label lblCreatedDate;
        protected Label lblOrderID;
        protected Label lblOwnerID;
        protected HtmlLink mycss;
        protected ScriptManager ScriptManager1;
        protected TextBox txtCreatedBy;
        protected TextBox txtCreatedDate;
        protected TextBox txtCreatedDate2;
        protected TextBox txtOrderID;
        protected TextBox txtOwnerID;

        protected void btnInvAccessorialCharges_Click(object sender, EventArgs e)
        {
            base.Server.Transfer(string.Format("AccessorialChargesDetail.aspx?action={0}&Type=InvCharges&from=query", base.UrlEncode(this.hdnActionID.Value.Trim())), false);
        }

        protected void btnList_Click(object sender, EventArgs e)
        {
            base.Server.Transfer(string.Format("AccessorialChargesList.aspx?action={0}&from=list", base.UrlEncode(this.hdnActionID.Value.Trim())), false);
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("AccessorialChargesList.aspx?action=" + base.UrlEncode(this.hdnActionID.Value), false);
        }

        private void LoadDDl()
        {
            base.InitQueryDDL(this.ddlAccessorialTypeOper, 0);
            base.InitQueryDDL(this.ddlOrderID, 0);
            base.InitQueryDDL(this.ddlOwnerID, 0);
            base.InitQueryDDL(this.ddlCreatedByOper, 0);
            base.InitQueryDDL(this.ddlCreatedDate, 1);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.LoadDDl();
            }
        }

        public string AccessorialType
        {
            get
            {
                if (!string.IsNullOrEmpty(this.ddlAccessorialType.SelectedValue))
                {
                    return this.ddlAccessorialType.SelectedValue;
                }
                return "";
            }
        }

        public string CreatedBy
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtCreatedBy.Text.Trim()))
                {
                    return base.GetParamsString(this.txtCreatedBy.Text.Trim(), this.ddlCreatedByOper.SelectedValue);
                }
                return "";
            }
        }

        public string CreatedDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtCreatedDate.Text.Trim()))
                {
                    return base.GetParamsString(this.txtCreatedDate.Text.Trim(), this.ddlCreatedDate.SelectedValue, this.txtCreatedDate2.Text.Trim(), "CreatedDate");
                }
                return "";
            }
        }

        public string OrderID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOrderID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOrderID.Text.Trim(), this.ddlOrderID.SelectedValue);
                }
                return "";
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlOwnerID.SelectedValue);
                }
                return "";
            }
        }
    }
}

